// webpack 的全局的配置文件  

const path = require('path')
module.exports = {
    mode: "development",  // 当前环境  test production development 
    entry: './src/main.js',    // 入口文件
    output: {  // 出口文件 
        path: path.join(__dirname, 'dist'),
        filename: 'bundle.js'
    },

    devtool: "source-map",

    module: {
        rules: [
            {
                test: /\.css$/,
                use: ['style-loader',
                    'css-loader'],
            },
            {
                test: /\.(sass|scss)$/,
                use: ['style-loader',
                    'css-loader', 'sass-loader']
            },
            {
                test: /\.less$/,
                use: ['style-loader',
                    'css-loader', 'less-loader']
            },
            {
                test: /\.js$/,
                // include
                exclude: /node_modules/,
                use: ['babel-loader']
            }
        ]
    }
}